package text;

import com.spring.study.bean.User;
import com.spring.study.service.UserService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

/**
 * @author: 若若叶
 * @date: 2021/8/10 13:08
 * FileName: UserTest
 * Description:
 */
@Component
public class UserTest {
    @Test
    public void test(){
        ApplicationContext applicationContext = new FileSystemXmlApplicationContext("E:\\JavaStudy\\SpringStudy\\text.xml");
        User user = applicationContext.getBean("user", User.class);
        user.print();

    }
    @Autowired
    private UserService userService;
    @Test
    public void test1(){
        int sub = userService.sub(2, 3);
        System.out.println(sub);
    }
}
